import 'package:json_annotation/json_annotation.dart';

part 'emotion_model.g.dart';


@JsonSerializable()
class EmotionModel extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'category')
  String category;

  @JsonKey(name: 'type')
  String type;

  @JsonKey(name: 'icon')
  String icon;

  @JsonKey(name: 'minVer')
  int? minVer;

  @JsonKey(name: 'chargeType')
  String chargeType;

  @JsonKey(name: 'unlock')
  int unlock;

  @JsonKey(name: 'items')
  List<EmotionItem> items;

  EmotionModel(this.id,this.category,this.type,this.icon,this.minVer,this.chargeType,this.unlock,this.items,);

  factory EmotionModel.fromJson(Map<String, dynamic> srcJson) => _$EmotionModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$EmotionModelToJson(this);

}


@JsonSerializable()
class EmotionItem extends Object {

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'phrase')
  String phrase;

  EmotionItem(this.url,this.name,this.phrase,);

  factory EmotionItem.fromJson(Map<String, dynamic> srcJson) => _$EmotionItemFromJson(srcJson);

  Map<String, dynamic> toJson() => _$EmotionItemToJson(this);

}